package com.cet.designpatterns.composite;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-09-12 21:52
 **/
public class Client {
    public static void main(String[] args) {
        OrganizationComponent university = new University("清华大学", "中国顶级大学");

        OrganizationComponent cCollege = new College("计算机学院", "大计院牛皮");
        OrganizationComponent ieCollege = new College("信息工程学院", "其他学院都是牛马");

        OrganizationComponent se = new Department("软件工程", "software engineer");
        OrganizationComponent ne = new Department("网络工程", "network engineer");
        OrganizationComponent csat = new Department("计算机科学与技术", "Computer Science and Technology");

        cCollege.add(se);
        cCollege.add(ne);
        cCollege.add(csat);

        OrganizationComponent ce = new Department("通信工程", "通信工程不好学");
        OrganizationComponent ie = new Department("信息工程", "信息工程不好学");

        ieCollege.add(ce);
        ieCollege.add(ie);

        university.add(cCollege);
        university.add(ieCollege);

        ieCollege.print();

        university.print();
    }
}
